export const Conditions = {
  'input': [
    {
      value: 'equals',
      label: '等于'
    },
    {
      value: 'not_equals',
      label: '不等于'
    },
    {
      value: 'contains',
      label: '包含'
    },
    {
      value: 'not_contains',
      label: '不包含'
    },
    {
      value: 'regex',
      label: '正则表达式'
    },
  ],
  'number': [
    {
      value: 'equals',
      label: '等于'
    },
    {
      value: 'not_equals',
      label: '不等于'
    },
    {
      value: 'lt',
      label: '小于'
    },
    {
      value: 'gt',
      label: '大于'
    },
    {
      value: 'lte',
      label: '小于等于'
    },
    {
      value: 'gte',
      label: '大于等于'
    },
    {
      value: 'between',
      label: '在值与值之间',
      format: '在{start}与{end}之间'
    },
    {
      value: 'not_between',
      label: '不在值与值之间',
      format: '不在{start}与{end}之间'
    },
  ],
  'choice': [
    {
      value: 'equals',
      label: '等于'
    },
    {
      value: 'not_equals',
      label: '不等于'
    },
    {
      value: 'contains',
      label: '包含'
    },
    {
      value: 'not_contains',
      label: '不包含'
    },
    {
      value: 'one_of_which',
      label: '是其中之一',
      format: '是{value}其中之一'
    },
    {
      value: 'not_one_of_which',
      label: '不是其中之一',
      format: '不是{value}其中之一'
    },
  ],
  'date': [
    {
      value: 'between',
      label: '在日期与日期之间'
    },
    {
      value: 'not_between',
      label: '不在日期与日期之间'
    },
  ]
}

export const StringConditionTypes = ['input', 'textarea']

export const NumberConditionTypes = ['number', 'rate', 'slider']

export const ChoiceConditionTypes = ['checkbox', 'select', 'range']
export const SwitchConditionTypes = ['switch']

export const DateConditionTypes = ['date', 'time', 'date-range', 'time-range']

export const ConditionMappings = {
  'common': '{compare} {value}',
}

export const ConditionPropsMappings = {
  'numberRange': [
    {
      key: '$.start.min',
      value: '$.options.min'
    },
    {
      key: '\$.start.max',
      value: '\$.options.max'
    },
    {
      key: '\$.start.precision',
      value: '\$.options.precision'
    },
    {
      key: '\$.start.step',
      value: '\$.options.step'
    },
    {
      key: '\$.end.min',
      value: '\$.options.min'
    },
    {
      key: '\$.end.max',
      value: '\$.options.max'
    },
    {
      key: '\$.end.precision',
      value: '\$.options.precision'
    },
    {
      key: '\$.end.step',
      value: '\$.options.step'
    },
  ],
  'number': [
    {
      key: '$.min',
      value: '$.options.min'
    },
    {
      key: '\$.max',
      value: '\$.options.max'
    },
    {
      key: '\$.precision',
      value: '\$.options.precision'
    },
    {
      key: '\$.step',
      value: '\$.options.step'
    },
  ],
  'choiceMulti': [
    {
      key: '$.multiple',
      default: true
    },
    {
      key: '$.clearable',
      default: true
    },
  ],
  'choice': [
    {
      key: '$.clearable',
      default: true
    },
  ]
}
